package com.zzyl.controller.customer;

import com.zzyl.base.ResponseResult;
import com.zzyl.controller.BaseController;
import com.zzyl.dto.WechatUserLoginDTO;
import com.zzyl.service.WechatUserLoginService;
import com.zzyl.service.impl.WechatUserLoginServiceImpl;
import com.zzyl.vo.LoginVo;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/customer/user")
public class WechatUserLoginController extends BaseController {

    @Resource
    private WechatUserLoginService wechatUserLoginService;
    /**
     * 微信用户登录，实现微信用户与小程序绑定
     * @return
     */
    @PostMapping("/login")
    public ResponseResult<LoginVo> login(@RequestBody WechatUserLoginDTO dto){
        logger.info("获取登录参数{}",dto);
        return wechatUserLoginService.login(dto);
    }
}

